# coding = utf-8

from django.urls import path
from rest_framework.routers import DefaultRouter

from .code_views import UnitListAPIView, StoreHouseListAPIView, CategoryTreeAPIView, CustSuppClassTreeAPIView, \
    GoodsListAPIView, SupplierListAPIView, CustomerListAPIView, GoodsCodeAPIView, Hanzi2Pinyin, \
    CustomerSupplierCodeAPIView, WareHouseEntryCodeAPIView, PurchasePayOrderCodeAPIView, SaleOrderCodeAPIView, \
    SaleReceiptCodeAPIView, CustomSupplierListAPIView, GoodsTransferCodeAPIView, PrepaymentCodeAPIView, \
    GoodsCodeListAPIView
from .views import UnitViewSet, StoreHouseViewSet, CategoryViewSet, CustSuppClassViewSet, CustomerViewSet, \
    SupplierViewSet, GoodsViewSet, CompanyViewSet, AccountTitleViewSet, EmployeeViewSet, EmployeeListAPIView

router = DefaultRouter()
# 后台
router.register(r'unit', UnitViewSet, basename="api-unit")
router.register(r'house', StoreHouseViewSet, basename="api-store-house")
router.register(r'category', CategoryViewSet, basename="api-category")
router.register(r'cust_supplier_class', CustSuppClassViewSet, basename="api-customer-supplier-class")
router.register(r'customer', CustomerViewSet, basename="api-customer")
router.register(r'supplier', SupplierViewSet, basename="api-supplier")
router.register(r'goods', GoodsViewSet, basename="api-goods")
router.register(r'company', CompanyViewSet, basename="api-company")
router.register(r'account', AccountTitleViewSet, basename="api-account")
router.register(r'employee', EmployeeViewSet, basename="api-employee")

urlpatterns = [
    # 编码
    path('unit_list/', UnitListAPIView.as_view(), name="api-unit-list"),
    path('house_list/', StoreHouseListAPIView.as_view(), name="api-store-house-list"),
    path('cate_list/', CategoryTreeAPIView.as_view(), name="api-category-tree"),
    path('cust_supplier_class_list/', CustSuppClassTreeAPIView.as_view(), name="api-customer-supplier-class-tree"),
    path('goods_list/', GoodsListAPIView.as_view(), name="api-goods-list"),
    path('goods_code_list/', GoodsCodeListAPIView.as_view(), name="api-goods-code-list"),
    path('supplier_list/', SupplierListAPIView.as_view(), name="api-supplier-list"),
    path('customer_list/', CustomerListAPIView.as_view(), name="api-customer-list"),
    path('custom_supplier_list/', CustomSupplierListAPIView.as_view(), name="api-custom-supplier-list"),
    path('goods_code/', GoodsCodeAPIView.as_view(), name="api-goods-code"),
    path('cust_supplier_code/', CustomerSupplierCodeAPIView.as_view(), name="api-cust-supplier-code"),
    path('entry_code/', WareHouseEntryCodeAPIView.as_view(), name="api-entry-code"),
    path('purchase_pay_code/', PurchasePayOrderCodeAPIView.as_view(), name="api-purchase-pay-code"),
    path('sale_order_code/', SaleOrderCodeAPIView.as_view(), name="api-sale-order-code"),
    path('sale_receipt_code/', SaleReceiptCodeAPIView.as_view(), name="api-sale-receipt-code"),
    path('goods_transfer_code/', GoodsTransferCodeAPIView.as_view(), name="api-goods-transfer-code"),
    path('prepayment_code/', PrepaymentCodeAPIView.as_view(), name="api-prepayment-code"),
    path('hz2py/', Hanzi2Pinyin.as_view(), name="api-hz-py"),
    path('employee_list/', EmployeeListAPIView.as_view(), name="api-employee-list"),

]
urlpatterns += router.urls
